#ifndef OBJFILELOADER_H
#define OBJFILELOADER_H

#include <vector>

#include "bga/system/Loader.h"
#include "bga/system/Tuple.h"

/*!
 * \namespace bga
 *
 */
namespace bga
{

class Drawable;

class BOARD_HELL_ENGINE ObjFileLoader : public Loader<Drawable>
{

    public:
        ObjFileLoader();
        ObjFileLoader(const ObjFileLoader& loaderCopy);
        virtual ~ObjFileLoader();

        virtual Drawable* load(File& file);

        void reset();

    private:

        typedef Tuple<3, float> OBJTripletFloat;
        typedef Tuple<2, float> OBJDoubletFloat;
        typedef Tuple<3, unsigned short> OBJTripletUS;

        /**
		 * \brief get the drawable associated to OBJ imported
		 * \param drawable : drawable object to fill
		 */
		virtual void getDrawable(Drawable* drawable);

		/**
         * \brief parse and get the three differents indices from the OBJ file : vertex index, texture coordinates, normal index
         * \param s : string to parse
         */
         /// TODO : Put that kind of fonction with tuple
        OBJTripletUS getIndices(const std::string& s);

        std::vector<OBJTripletFloat> listVertex;      ///!< list of vertex coordinates
        std::vector<OBJDoubletFloat> listTexCoord;    ///!< list of vertex texture coordiantes
        std::vector<OBJTripletFloat> listNormals;     ///!< list of vertex normal
        std::vector<OBJTripletUS> listIndices;        ///!< list of indices


};

}

#endif // OBJFILELOADER_H

